<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MovieClipTest</title>
<script type="text/javascript"  src="../../flash/FlashCore.js"></script>
<!---->
 <script type="text/javascript" src="../../flash/geom/Point.js"></script> 
 <script type="text/javascript" src="../../flash/geom/Rectangle.js"></script> 
 <script type="text/javascript" src="../../flash/geom/Matrix.js"></script> 
<!---->
 <script type="text/javascript" src="../../flash/events/Event.js"></script> 
 <script type="text/javascript" src="../../flash/events/EventDispatcher.js"></script> 
 <script type="text/javascript" src="../../flash/events/KeyboardEvent.js"></script> 
 <script type="text/javascript" src="../../flash/events/MouseEvent.js"></script> 
 <script type="text/javascript" src="../../flash/events/ProgressEvent.js"></script> 
 <script type="text/javascript" src="../../flash/events/TimerEvent.js"></script> 
 <script type="text/javascript" src="../../flash/events/IOErrorEvent.js"></script> 
<!---->
 <script type="text/javascript" src="../../flash/net/URLVariables.js"></script> 
 <script type="text/javascript" src="../../flash/net/URLRequest.js"></script> 
 <script type="text/javascript" src="../../flash/net/URLRequestMethod.js"></script> 
 <script type="text/javascript" src="../../flash/net/URLLoaderDataFormat.js"></script> 
 <script type="text/javascript" src="../../flash/net/URLLoader.js"></script> 

<script type="text/javascript"  src="../../flash/display/DisplayObject.js"></script>
<script type="text/javascript"  src="../../flash/display/InteractiveObject.js"></script>
<script type="text/javascript"  src="../../flash/display/DisplayObjectContainer.js"></script>
<script type="text/javascript"  src="../../flash/display/Stage.js"></script>
<script type="text/javascript"  src="../../flash/display/BitmapData.js"></script>
<script type="text/javascript"  src="../../flash/display/Bitmap.js"></script>
<script type="text/javascript"  src="../../flash/display/Loader.js"></script>
<script type="text/javascript"  src="../../flash/display/Graphics.js"></script>
<script type="text/javascript"  src="../../flash/display/Shape.js"></script>
<script type="text/javascript"  src="../../flash/display/Sprite.js"></script>
<script type="text/javascript"  src="../../flash/display/MovieClip.js"></script>
<script type="text/javascript" >

window.onload = function(){
	//框架主程序入口
	var core = new FlashCore();
	core.setCanvas( document.getElementById("cav"));
	core.start();
	
	//对stage进行一些参数设置
	var stage = FlashCore.stage;
	//加载图片
	var loader = new Loader();
	//MovieClip变量
	var mc ;
	//加载完成
	function loadedHandler(event){
		loader.removeEventListener( Event.COMPLETE , loadedHandler) ;
		var bmp = event.getTarget().getContent();
		mc = new MovieClip( bmp.getBitmapData() , bmp.getWidth()/4 , bmp.getHeight()/4 , 8 );
		for( var i=0 ; i<4 ; ++i){
			for( var j= 0 ; j<4 ; ++j){
				mc.addFrame( new Rectangle(mc.getWidth()*j , mc.getHeight()*i , mc.getWidth() , mc.getHeight() ) ) ;
				//document.getElementById("debug").innerHTML+=new Rectangle(mc.getWidth()*j , mc.getHeight()*i , mc.getWidth() , mc.getHeight() )+"<br/>" ;
			}
		}
		mc.setPivotX(mc.getWidth()*0.5 );
		mc.setPivotY(mc.getHeight()*0.5 );
		mc.setX(200);
		mc.setY(200);
		stage.addChild( mc );
		mc.play();
	}
	loader.addEventListener( Event.COMPLETE , loadedHandler) ;
	loader.load( new URLRequest("../res/queue.png") ) ;
	
	
	
	function onEnterFrame(event){
		if(mc){
			mc.setRotation( mc.getRotation()+3 );
		}
	}
	stage.addEventListener( Event.ENTER_FRAME , onEnterFrame);
} ;

--></script>
</head>
<body>
<canvas id="cav" width="500" height="400px" style="background-color: #000000 ;">你的浏览器不支持HTML5。</canvas>
<div id="debug"></div>
</body>
</html>